package com.coffee.attachment;

import com.coffee.attachment.entity.AttachConverter;
import com.coffee.attachment.entity.AttachDocumentEntity;
import com.coffee.attachment.entity.AttachVisualEntity;
import com.coffee.attachment.service.MochaAttachmentService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: songkui
 * @since: 2023/4/20 15:34
 */
@Slf4j
@RestController
@RequestMapping("/coffee/attach-save")
@AllArgsConstructor
public class CoffeeAttachmentFacade {
    private final MochaAttachmentService mochaAttachmentService;
    @PostMapping("/document")
    public Long saveDocument(@RequestBody ExcelDocumentDTO dto){
       return mochaAttachmentService.saveDocument(AttachConverter.buildDocEntity(dto));
    }


    @PostMapping("/visual")
    public Long saveVisual(@RequestBody AttachVisualDTO dto){
       return mochaAttachmentService.saveVisual(AttachConverter.buildVisualEntity(dto));
    }

    //TODO 上传附件

    //TODO 下载附件



}
